home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / linuxcon.000 / linuxcon / linuxconf-1.6 / translate / internal.h < prev    next >
C/C++ Source or Header  |  1996-07-31  |  2KB  |  97 lines

  1. #pragma interface
  2. #ifndef INTERNAL_H
  3. #define INTERNAL_H
  4.  
  5. #define MAXLEN_DICTNAME    19
  6.  
  7. #ifndef MISC_H
  8.     #include "../misc/misc.h"
  9. #endif
  10.  
  11. class LANG_STRING: public ARRAY_OBJ{
  12. public:
  13.     char lang;
  14.     SSTRING str;
  15.     /*~PROTOBEG~ LANG_STRING */
  16. public:
  17.     LANG_STRING (char _lang, const char *_str);
  18.     /*~PROTOEND~ LANG_STRING */
  19. };
  20.  
  21.  
  22. class LANG_STRINGS: public ARRAY{
  23.     /*~PROTOBEG~ LANG_STRINGS */
  24. public:
  25.     LANG_STRING *getitem (int no);
  26.     /*~PROTOEND~ LANG_STRINGS */
  27. };
  28.  
  29. class TR_STRING: public ARRAY_OBJ{
  30. protected:
  31.     int changed;
  32.     SSTRING id;
  33.     SSTRING comment;
  34.     SSTRING origin;        // Source file declaring this message
  35.                         // This info is not actually saved in the dictionnary
  36.     LANG_STRINGS tb;
  37.     /*~PROTOBEG~ TR_STRING */
  38. public:
  39.     TR_STRING (const char *_id);
  40.     void add2comment (const char *_comment);
  41.     void deltranslation (char lang);
  42.     const char *getid (void);
  43.     const char *getmsg (char lang);
  44.     int getnblang (void);
  45.     const char *getorigin (void);
  46.     LANG_STRING *gettranslation (char lang);
  47.     void reset_changed (void);
  48.     void setorigin (const char *str);
  49.     SSTRING *settranslation (char lang, const char *str);
  50.     int was_changed (void);
  51.     void write (FILE *fout);
  52.     /*~PROTOEND~ TR_STRING */
  53. };
  54.  
  55. class TR_STRINGS: public ARRAY{
  56.     int version;
  57.     /*~PROTOBEG~ TR_STRINGS */
  58. public:
  59.     TR_STRINGS (void);
  60.     void deltranslation (char lang);
  61.     TR_STRING *getitem (const char *id);
  62.     TR_STRING *getitem (int no);
  63.     int getversion (void);
  64.     int read (const char *fname);
  65.     void setversion (int ver);
  66.     void showold (char deflang);
  67.     int write (const char *fname);
  68.     int write_mod (const char *fname);
  69.     int writeh (const char *sysname, const char *fname);
  70.     /*~PROTOEND~ TR_STRINGS */
  71. };
  72.  
  73. // Structures for the compiled dictionnary
  74.  
  75.  
  76. #define BDICT_MAGIC    0x9867
  77. #define BDICT_VERSION    2
  78. struct BDICT_HEADER{
  79.     short unsigned magic;
  80.     short unsigned version;
  81.     short int nbsys;    // Number of systems
  82. };
  83.  
  84. struct BDICT_SYSTEM{
  85.     char name[MAXLEN_DICTNAME+1];    // Name of the system
  86.     short int version;
  87.     short int nbmsg;        // Number of message
  88. };
  89.  
  90. #ifndef _STDIO_H
  91.     #include <stdio.h>
  92. #endif
  93.  
  94. #include "translate.p"
  95.  
  96. #endif
  97.